package hu.plajko.server.jdo;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable
public class Data {

	public Key getKey() {
		return key;
	}

	public void setKey(Key key) {
		this.key = key;

	}

	public String getData() {
		return data;
	}

	@Override
	public String toString() {
		return data;
	}

	public void setData(String data) {
		this.data = data;
	}

	public Data() {

	}

	public Data(String data, Date timestamp,String address) {
		super();
		this.data = data;
		this.timestamp = timestamp;
		this.setAddress(address);
	}

	public void setTimestamp(Date timestamp) {
		this.timestamp = timestamp;
	}

	public Date getTimestamp() {
		return timestamp;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getAddress() {
		return address;
	}

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;

	@Persistent
	private String data;
	
	@Persistent
	private String address;

	@Persistent
	private Date timestamp;

}
